package com.dt.app.api.shopping.service.impl;

import com.dt.app.modules.shopping.entities.DsCategory;
import com.dt.app.modules.shopping.vo.DsCategoryBean;
import com.dt.app.api.shopping.mapper.DsCategoryMapper;
import com.dt.app.api.shopping.service.IDsCategoryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 鸿源塔基
 * @since 2023-02-25
 */
@Service
public class DsCategoryServiceImpl extends ServiceImpl<DsCategoryMapper, DsCategory> implements IDsCategoryService {
    public DsCategory getEntity(DsCategoryBean bean){
        DsCategory entity = new DsCategory();
        entity.setDsCategoryId(bean.getDsCategoryId());
        entity.setSysCompanyId(bean.getSysCompanyId());
        entity.setCategoryTypeId(bean.getCategoryTypeId());
        entity.setCategoryTypeIdSeller(bean.getCategoryTypeIdSeller());
        entity.setCountryId(bean.getCountryId());
        entity.setCategoryName(bean.getCategoryName());
        entity.setCategoryDescription(bean.getCategoryDescription());
        entity.setCategoryCode(bean.getCategoryCode());
        entity.setProductCount(bean.getProductCount());
        entity.setMetaKeyword(bean.getMetaKeyword());
        entity.setMetaDescription(bean.getMetaDescription());
        entity.setMembershipLevel(bean.getMembershipLevel());
        entity.setStatus(bean.getStatus());
        entity.setCreateBy(bean.getCreateBy());
        entity.setUpdateBy(bean.getUpdateBy());
        entity.setCreateTime(bean.getCreateTime());
        entity.setUpdateTime(bean.getUpdateTime());
        entity.setTemplatePath(bean.getTemplatePath());
        entity.setCategoryPath(bean.getCategoryPath());
        entity.setImageUrl(bean.getImageUrl());
        entity.setYdImageurl(bean.getYdImageurl());
        entity.setIsFrontMenu(bean.getIsFrontMenu());
        entity.setYdIsfrontmenu(bean.getYdIsfrontmenu());
        entity.setLevel(bean.getLevel());
        entity.setParentId(bean.getParentId());
        entity.setIsHadChild(bean.getIsHadChild());
        entity.setSeq(bean.getSeq());
        entity.setDeleted(bean.getDeleted());
        return entity;
    }
    public DsCategoryBean getBean(DsCategory entity){
        DsCategoryBean bean = new DsCategoryBean();
        bean.setDsCategoryId(entity.getDsCategoryId());
        bean.setSysCompanyId(entity.getSysCompanyId());
        bean.setCategoryTypeId(entity.getCategoryTypeId());
        bean.setCategoryTypeIdSeller(entity.getCategoryTypeIdSeller());
        bean.setCountryId(entity.getCountryId());
        bean.setCategoryName(entity.getCategoryName());
        bean.setCategoryDescription(entity.getCategoryDescription());
        bean.setCategoryCode(entity.getCategoryCode());
        bean.setProductCount(entity.getProductCount());
        bean.setMetaKeyword(entity.getMetaKeyword());
        bean.setMetaDescription(entity.getMetaDescription());
        bean.setMembershipLevel(entity.getMembershipLevel());
        bean.setStatus(entity.getStatus());
        bean.setCreateBy(entity.getCreateBy());
        bean.setUpdateBy(entity.getUpdateBy());
        bean.setCreateTime(entity.getCreateTime());
        bean.setUpdateTime(entity.getUpdateTime());
        bean.setTemplatePath(entity.getTemplatePath());
        bean.setCategoryPath(entity.getCategoryPath());
        bean.setImageUrl(entity.getImageUrl());
        bean.setYdImageurl(entity.getYdImageurl());
        bean.setIsFrontMenu(entity.getIsFrontMenu());
        bean.setYdIsfrontmenu(entity.getYdIsfrontmenu());
        bean.setLevel(entity.getLevel());
        bean.setParentId(entity.getParentId());
        bean.setIsHadChild(entity.getIsHadChild());
        bean.setSeq(entity.getSeq());
        bean.setDeleted(entity.getDeleted());
        return bean;
    }
}
